# encoding    : utf-8
# author      : 伦裕如
# project     : hrjt_-py1
# file        : excelManage
# time        : 2024-06-21 上午10:28
import openpyxl


class ExcelManage:

    def __init__(self, file, sheet):
        """
        初始化方法
        :param file:
        """
        self.file = file
        self.wb = openpyxl.load_workbook(self.file)
        if sheet in self.wb.sheetnames:
            self.ws = self.wb[sheet]
        else:
            self.ws = self.wb.create_sheet(sheet)

    def connect(self):
        self.wb = openpyxl.load_workbook(self.file)



